import { Component } from '@angular/core';
import {NzButtonComponent} from "ng-zorro-antd/button";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzListComponent, NzListItemComponent} from 'ng-zorro-antd/list';
import {RedisService} from '../../services/redis.service';

@Component({
  selector: 'app-allow-request',
  standalone: true,
  imports: [
    NzButtonComponent,
    NzColDirective,
    NzInputDirective,
    NzRowDirective,
    NzListComponent,
    NzListItemComponent
  ],
  templateUrl: './allow-request.component.html',
  styleUrl: './allow-request.component.css'
})
export class AllowRequestComponent {

  constructor(private RedisService: RedisService) {}

  msgs: String[] = []

  callFunction(){
    this.RedisService.allRequest().subscribe(res => {
      if(res){
        this.msgs.push("调用接口成功！")
      }else{
        this.msgs.push("接口限流了！！！");
      }
    })
  }
}
